package com.lm.activiti.boot.cases;

import com.lm.activiti.boot.cases.dto.ParentProperties;
import net.coobird.thumbnailator.Thumbnails;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;

import java.io.IOException;
import java.lang.reflect.Field;

/**
 * @author lm_jcf
 * @date 2020/4/22 14:57
 */
public class StringTest {

    @Test
    public void stringData() throws NoSuchFieldException, IllegalAccessException, InstantiationException {
        String str = "不在相信";

        Class cla = str.getClass();

        Field[] fields = cla.getDeclaredFields();

        Field name = cla.getDeclaredField("value");
        name.setAccessible(true);

        char[] o = (char[]) name.get(str);
        for (int i = 0; i < o.length; i++) {
            System.out.println(o[i]);
        }
    }

    @Test
    public void containsAny(){
        String[] standard = {"家长", "老师", "师"};

        String verifier = "李明家";

//        System.out.println(StringUtils.containsAny(verifier, standard));
    }

    @Test
    public void paramPlus(){
        int number = 2;

        this.paramPlus(number, number += 2);
        System.out.println(number);

    }

    public void paramPlus(int initNumber, int number) {
        System.out.println(initNumber + "-" + number);

    }

    @Test
    public void test() throws IOException {
        Thumbnails.of("C:\\Users\\lm_jcf\\Desktop\\1-c.jpg").scale(0.12f).outputQuality(0.28f).toFile("C:\\Users\\lm_jcf\\2-c.jpg");

    }
}
